﻿using System;
using System.Windows.Forms;
using SFML.Graphics;
using Strom.Client.Graphic;

namespace Strom.Client.GUI
{
    public partial class FormGame : Form
    {
        public FormGame()
        {
            InitializeComponent();
            ClientManager.GUI.Game = this;
        }

        private void frmGame_Load(object sender, EventArgs e)
        {
            CheckForIllegalCrossThreadCalls = false;
            this.Text = ClientManager.Client.Client.CurrentCharacter.Name;
        }

        protected override void OnClosed(EventArgs e)
        {
            ClientManager.GUI.Login.Close();
            Initializer.Unload();
        }

        private void frmGame_Shown(object sender, EventArgs e)
        {
            Var.RenderWin = new RenderWindow(this.picGame.Handle);
            Initializer.Load();
            GameLoop.Start();
        }
    }
}
